package Control;

import Entity.MsgPackage;
import GUI.EditReqStageManagerGui;
import GUI.ScreenManager;

public class EditReqStageMangerControl {

	private EditReqStageManagerGui editManger_gui;
	private MsgPackage editMsg;
	private  String request_num;
	private String stage_num;
	
	public EditReqStageMangerControl()
	{
	editManger_gui = new EditReqStageManagerGui();
	editMsg= new MsgPackage(); 
	}
	
	public EditReqStageManagerGui getEditMangerGui(){
		return editManger_gui;
	}

	public void ExtentionRequest_pressed(String ReqNum,String StageNum){
		
		editMsg.setObject(request_num);
		editMsg.setObject(stage_num);
		editMsg.setObject(OP_CODE.EXTENTION_STAGE);
		ScreenManager.getConnection().accept(editMsg);
	
	}
	public int update_pressed(){
		editMsg.setObject(request_num);
		editMsg.setObject(stage_num);
		if (stage_num == "1")
		{
		editMsg.setObject(OP_CODE.ESTIMATION_STAGE);
		ScreenManager.getConnection().accept(editMsg);
		return 1;
		}
		else if (stage_num == "2")
		{
		editMsg.setObject(OP_CODE.EXAMINATION_STAGE);
		ScreenManager.getConnection().accept(editMsg);
		return 2;
		}
		else if (stage_num == "3")
		{
		editMsg.setObject(OP_CODE.PERFORMANCE_STAGE);
		ScreenManager.getConnection().accept(editMsg);
		return 3;
		}
		else if (stage_num == "4")
		{
		editMsg.setObject(OP_CODE.TESTING_STAGE);
		ScreenManager.getConnection().accept(editMsg);
		return 4;
		}
		else if (stage_num == "5")
		{
		editMsg.setObject(OP_CODE.CLOSURE_STAGE);
		ScreenManager.getConnection().accept(editMsg);
		return 5;
		}
		return 0;
		}
	public void setEditManger_gui(EditReqStageManagerGui editManger_gui) {
		this.editManger_gui = editManger_gui;
	}
	public MsgPackage getEditMsg() {
		return editMsg;
	}
	public void setEditMsg(MsgPackage editMsg) {
		this.editMsg = editMsg;
	}
	public String getRequest_num() {
		return request_num;
	}
	public void setRequest_num(String request_num) {
		this.request_num = request_num;
	}
	public String getStage_num() {
		return stage_num;
	}
	public void setStage_num(String stage_num) {
		this.stage_num = stage_num;
	}

}
